import { ExtractPropTypes } from 'vue'
import { ZIndex } from '../../config'

/**
 * Toast设置配置类型
 */
export type ToastOption = {
  /** toast关闭时间 */
  duration?: number,
  /** 标题 */
  title?: string,
  /** 图标 */
  icon?: string
}

/**
 * props参数
 */
export const toastProps = {
  /** zIndex */
  zIndex: {
    type: [String, Number],
    default: ZIndex.toast
  },
  /** 显示遮罩 */
  mask: {
    type: Boolean,
    default: false
  }
}
export type ToastProps = ExtractPropTypes<typeof toastProps>

export const toastEmits = {
  /** 窗口关闭 */
  close: () => true
}
export type ToastEmits = typeof toastEmits
